import request from "@/plugin/axios";

const BASE_URL = "sys/dept";

export function OrganizeTree(parentId) {
  return request({
    url: BASE_URL + "/" + parentId + "/tree",
    method: "get",
  });
}

export function OrganizeSimpleTree(parentId, params) {
  return request({
    url: BASE_URL + "/simple/" + parentId,
    method: "get",
    params,
  });
}

export function OrganizeUpdate(data) {
  return request({
    url: BASE_URL + "/" + data.id,
    method: "put",
    data,
  });
}

export function OrganizeAdd(data) {
  return request({
    url: BASE_URL,
    method: "post",
    data,
  });
}

export function OrganizeDel(id) {
  return request({
    url: BASE_URL + "/" + id,
    method: "delete",
  });
}

export function OrganizeSimpleAllTree(data) {
  return request({
    url: BASE_URL + "/simple/all/tree",
    method: "get",
    params: data,
  });
}

export function OrganizeSearchOrg(params) {
  return request({
    url: BASE_URL + "/search-org",
    method: "get",
    params,
  });
}
// 查询部门下所有的用户
export function UserSimpleList(deptId) {
  return request({
    url: BASE_URL + "/" + deptId + "/user",
    method: "get",
    // params: data
  });
}
